import React from 'react'
import PropTyeps from 'prop-types'
import { withStyles } from 'material-ui/styles'
import Sms from 'material-ui-icons/Sms'
import Face from 'material-ui-icons/Face'
import createStyle from './style'

const TopicTips = (props) => {
  const tab = props.good ? '精品' : (props.top ? '置顶' : null) //eslint-disable-line
  return (
    <div className={props.classes.topicTips}>
      { (props.good || props.top) ?
        <span className={props.classes.tab}>{tab}</span>
        :
        null
      }
      <span className={props.classes.lastReplyAt}>回复于: {props.lastReplyAt}</span>
      <span className={props.classes.visitCount}>
        <Face className={props.classes.relayIcon} />
        {props.visitCount}
      </span>
      <span className={props.classes.replayCount}>
        <Sms className={props.classes.relayIcon} />
        {props.replyCount}
      </span>
    </div>
  )
}

export default withStyles(createStyle)(TopicTips)
TopicTips.propTypes = {
  classes: PropTyeps.objectOf(Object),
  tab: PropTyeps.string,
  lastReplyAt: PropTyeps.string,
  replyCount: PropTyeps.number,
  visitCount: PropTyeps.number,
  top: PropTyeps.bool,
  good: PropTyeps.bool,
}

